﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Celestial Home - Extracting every detail of your dream</title>
    <link rel="Stylesheet" type="text/css" href="css/master.css" />
    <link rel="Stylesheet" type="text/css" href="css/login.css" />
	
	<script type="text/javascript" src="javascripts/helpers.js"></script>
	<script type="text/javascript" src="javascripts/login.js"></script>
	<script type="text/javascript" src="javascripts/OrderScript.js"></script>
	
	<script>
		window.onload=function(){
			checkLogin();
		}
		function requestXMLAjaxCall(url,funcName){
			//check for login and extract customerID for parameter before actual ajax call
			var strCustomerID = getCookie("CustomerID");
			if (strCustomerID!=""){
				var id;
				id='customerID=' + strCustomerID;
				XMLAjaxCall(url,funcName,id);
			}
			else{
				alert("Please login first");
//insert login url				
//window.location="http://www.someplace.com/other.html";
			}
		}
	</script>
</head>
<body>

<div id="divTitle">
    <div id="divCustMenu">
        <img src="images/user.png" alt="user" /><a id="aLogin" href="login.html">Login</a> |
        <img src="images/profile.png" alt="profile" /><a id="aProfile" href="particulars.html">My Profile</a> |
        <img src="images/cart.png" alt="cart" /><a href="construct.html">My Cart</a> | 
        <img src="images/checkout.png" alt="checkout" /><a href="construct.html">Checkout</a>
    </div><!--ends divCustmenu-->
    <div id="divWelcome"></div>
</div><!--ends divTitle-->

<!-- Navigation Bar - common for all pages -->
<div id="divNavBar">
    <ul id="ulNavBar">
        <li><img src="images/home.png" alt="home"/><a href="index.html"> Home</a></li>
        <li><img src="images/briefcase.png" alt="home"/><a href="about.html"> About Us</a></li>
        <li><img src="images/chair.png" alt="home"/><a href="construct.html"> Products</a>
            <ul>
                <li><a href="construct.html">Bed Room</a>
                    <ul>
                        <li><a href="construct.html">Beds</a></li>
                        <li><a href="construct.html">Wardrobes</a></li>
                    </ul>
                </li>
                <li><a href="construct.html">Dining Room</a>
                    <ul>
                        <li><a href="construct.html">Chairs</a></li>
                        <li><a href="construct.html">Dining Tables</a></li>
                        <li><a href="construct.html">Dining Table Sets</a></li>
                    </ul>
                </li>
                <li><a href="construct.html">Living Room</a>
                    <ul>
                        <li><a href="construct.html">Coffee Tables</a></li>
                        <li><a href="construct.html">Sofa</a></li>
                        <li><a href="construct.html">Sofa Sets</a></li>
                        <li><a href="construct.html">TV Cabinets</a></li>
                    </ul>
                </li>
                <li><a href="construct.html">Study Room</a>
                    <ul>
                        <li><a href="construct.html">Desks</a></li>
                        <li><a href="construct.html">Book Shelves</a></li>
                    </ul>
                </li>
            </ul>
        </li> <!--ends Products menu-->
        <li><img src="images/design.png" alt="home"/><a href="construct.html"> Design</a>
            <ul>
                <li><a href="construct.html">Wardrobe</a></li>
                <li><a href="construct.html">Home Theatre</a></li>
            </ul>
        </li> <!--ends design menu-->
        <li><img src="images/earth.png" alt="home"/><a href="construct.html"> Support</a>
            <ul>
                <li ><a href="contact.html">Contact Us</a></li>
                <li><a href="construct.html">Track Your Order</a></li>
            </ul>
        </li> <!--ends support menu-->
    </ul>  <!--ends navigation menu-->
</div> <!--ends navigation division--> 

<div id="divMain">
		<table width="100%">
		<!-- ViewOrderHistory_wTemp -->
			<tr>
				<table border="1" frame="box" rules="all" id="OrderHistoryDisplay">
					<tr>
						<td>Order ID</td>
						<td>Order Date</td>
						<td>Amount</td>
						<td>Status</td>
					<tr>
				</table>
			</tr>
			<tr>
				<td>
					<input type="button" value="Load Detail" onclick="requestXMLAjaxCall('ViewOrderHistoryServlet?timeStamp='+ new Date().getTime(),loadOrders);"/>
				</td>
				<td>
					<input type="button" value="Next Order" onclick="nextOrder();requestXMLAjaxCall('ViewOrderHistoryServlet?timeStamp='+ new Date().getTime(),loadOrders);"/>
				</td>
			</tr>
			<tr>
				<table border="1" frame="box" rules="none">
					<tr>
						<td colspan="3" id="ordHistOrdID">Order ID:</td>
					</tr>
					<tr>
						<td colspan="3" height="2"><hr style="height: 100%; background-color: #005073"/></td>
					</tr>
					<tr>
						<td width="300"  id="ordHistCustID">Cust ID:</td>
						<td width="300">Order Date: </td>
						<td  id="ordHistOrdDateVal"></td>
					</tr>
					<tr>
						<td id="ordHistCustName">Cust Name:</td>
						<td>Delivery Date:</td>
						<td id="ordHistDeliveryDateVal"></td>
					</tr>
					<tr>
						<td> </td>
						<td style="color: red; font: bold larger">STATUS:</td>
						<td id="ordHistStatusValue"></td>
					</tr>
					<tr>
						<td style="text-decoration: underline">Order Items:</td>
						<td></td>
						<td></td>
					</tr>
					
					<!-- Start of List-->
					<tr>
						<td colspan="3"><table id="ProductList">
							<tr><td width="300"></td><td width="300"></td></tr>
						</table></td>
					</tr>
					
					<!-- repeat till end of list-->
					
					<tr> <td colspan="3" height="2"><hr style="height: 100%; background-color: #005073"/></td> </tr>
					
					<tr>
						<td colspan="2">Total:</td>
						<td id="ordHistTotalAmount"></td>
					</tr>
				</table>
			</tr>
		</table>

<!-- ViewOrderHistory_wTemp -->
</div>

<div id="divFooter">
    <div id="divFooterLeft">&#169 Copyright 2010 Celestial Home</div>
    <div id="divFooterRight"> Site Design by <a href="#" id="aDreamArchitect"><img src="images/dream.png" alt="Dream Architect"/></a></div>
    <div id="divFooterCenter"><img src="images/visa.gif" alt=""/><img src="images/paypal.png" alt="" /></div>
</div><!--ends divFooter-->


</body>
</html>
